#include "EnemyManager.h"
#include "Enemy.h"
#include "BasicEnemy.h"
#include "PatrolEnemy.h"
#include "BossEnemy.h"


CEnemyManager::CEnemyManager()
{
}
CEnemyManager::~CEnemyManager()
{
}

void CEnemyManager::AddEnemy(ENEMIES enemy)
{
	CEnemy *l_Enemy = NULL;

	switch (enemy)
	{
		case BASIC:
			l_Enemy= new CBasicEnemy();
			break;
		case PATROL:
			l_Enemy= new CPatrolEnemy();
			break;
		case BOSS:
			l_Enemy= new CBossEnemy();
			break;
	}
	if(l_Enemy!=NULL)
	{
		m_Enemy.push_back(l_Enemy);
	}
}

void CEnemyManager::Update()
{
	std::vector<CEnemy *>::const_iterator it;
	std::vector<CEnemy *>::const_iterator it_end(m_Enemy.end());
	for (it = m_Enemy.begin(); it!=it_end; ++it)
	{
		(*it)->Update();
	}
}

void CEnemyManager::Render()
{
	std::vector<CEnemy *>::const_iterator it;
	std::vector<CEnemy *>::const_iterator it_end(m_Enemy.end());
	for (it = m_Enemy.begin(); it!=it_end; ++it)
	{
		(*it)->Render();
	}
}
